package com.test.entity.maindatachange;

import com.alibaba.fastjson.JSON;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: bj910
 * Date:2023-11-07
 * Time: 21:38
 * To change this template use File | Settings | File Templates.
 */
public class Map2Json {
    public static void main(String[] args) {
        Map<String,Object> map = new HashMap<>();

        map.put("workflowTitle","测试");
        map.put("demandType","C类需求");

        List<Person> productApprover = new ArrayList<>();
        Person person = new Person("朱琪", "user", "7e52c7a7299540a38a5bb6ccef0f402d");
        productApprover.add(person);
        map.put("productApprover",productApprover);




        String jsonString = JSON.toJSONString(map);
        System.out.println(jsonString);
    }
}

class Person{
    private String scopeName;
    private String scopeType;
    private String scopeValue;

    public Person(String scopeName, String scopeType, String scopeValue) {
        this.scopeName = scopeName;
        this.scopeType = scopeType;
        this.scopeValue = scopeValue;
    }

    public Person() {
    }

    public String getScopeName() {
        return scopeName;
    }

    public void setScopeName(String scopeName) {
        this.scopeName = scopeName;
    }

    public String getScopeType() {
        return scopeType;
    }

    public void setScopeType(String scopeType) {
        this.scopeType = scopeType;
    }

    public String getScopeValue() {
        return scopeValue;
    }

    public void setScopeValue(String scopeValue) {
        this.scopeValue = scopeValue;
    }
}